﻿using System;

namespace Homework3
{
    enum ShapeType
    {
        Rectangle, Square, Triangle
    }
    class ShapeFactory
    {
        System.Random random = new Random();
        readonly int max = 1919810, min = -114514;
        public IShape GetShape(ShapeType type)
        {
            switch (type)
            {
                case ShapeType.Rectangle:
                    return new Rectangle(random.Next(min,max), random.Next(min,max));
                case ShapeType.Square:
                    return new Square(random.Next(min,max));
                case ShapeType.Triangle:
                    return new Triangle(random.Next(min,max), random.Next(min,max));
                default:
                    return null;
            }
        }
    }
}
